<div class="title">Studienrichtungen verwalten</div>

<?php
echo $this->element('flashMessage');

$out  = '';

if(!empty($this->data)){
	$out .= '
	<table>
		<tr>
			<th>Name</th>
			<th>Beschreibung</th>
			<th>Aktion</th>
		</tr>
	';

	foreach ($this->data as $key => $value){
		$out .= '
		<tr>
			<td>'.$value['StudyBranch']['branch_name'].'</td>
			<td>'.$value['StudyBranch']['free_text'].'</td>
			<td>';
		$out .= $this->Html->link('Ändern',array('action'=>'update',$value['StudyBranch']['id']));
		$out .= ' '.$this->Html->link('Löschen',array('action'=>'delete',$value['StudyBranch']['id']));
		$out .='
			</td>
		</tr>
		';

	}

	$out .= '
		</table>
	';

}else{

	$out .= $this->Html->link('>> Jetzt Studienrichtung anlegen', array('controller' => 'studyBranches', 'action' => 'add'));

}

echo $out;

?>